



import sys
import os
from sets import Set

"""
path = os.path.dirname( __file__)
if path == "":
  base = os.getcwd()
  base = os.path.abspath(base+"\\..")
else:
  base = os.path.abspath(path+"\\..")

dbpath = base +"\\utils"

sys.path.append(dbpath)
#print sys.path

import config
"""
try:
  from generator.utils import config
except:
  from utils import config

class Tables:
  def __init__(self):
    self.cfg = config.Config('tables.cfg')
    self.tables = {}
    self.s = Set()
    
  def gettabs(self):
    
    for x in self.cfg.options('tables'):
      self.tables[x] = self.cfg.getOption('tables', x)
    return self.tables
    
  def getmods(self):
    for t in self.tables:
      v =  tabs[t]
      if v in self.s:
        pass
      else:
        self.s.add(v)
    return self.s
  

if __name__ == "__main__":
  
  t = Tables()
  tabs = {}
  tabs = t.gettabs()
  # tabs
  #print t.getmods()

  

